home *** CD-ROM | disk | FTP | other *** search
/ Champak 49 / Volume 49 - JOGO DISK .iso / Games / bloop.swf / scripts / DefineSprite_52_bloop / frame_1 / DoAction.as
Text File  |  2007-09-27  |  2KB  |  96 lines

  1. if(!speed)
  2. {
  3.    gotoAndStop(random(_totalframes - 2) + 1);
  4.    letters = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];
  5.    speed = random(_root.level) + 0.2 + random(20) / 100;
  6.    letternum = random(25);
  7.    lettername = letters[letternum];
  8.    letternum += 66;
  9.    _root.setFrame(this);
  10. }
  11. onEnterFrame = function()
  12. {
  13.    if(_root.hud.levelmode._currentframe > 5)
  14.    {
  15.       removeMovieClip(this);
  16.    }
  17.    _root.checkFrame(this);
  18.    if(!float && !dead)
  19.    {
  20.       if(_X < 52)
  21.       {
  22.          _X++;
  23.       }
  24.       if(_X > Stage.width - 52)
  25.       {
  26.          _X--;
  27.       }
  28.       _Y = _Y + speed;
  29.       if(_Y > Stage.height)
  30.       {
  31.          _root.hud.pain.play();
  32.          removeMovieClip(this);
  33.          _root.lives -= 1;
  34.       }
  35.       if(_root.cannon.hitTest(this))
  36.       {
  37.          dead = true;
  38.       }
  39.       if(_root.bombout._currentframe > 1)
  40.       {
  41.          donttake = true;
  42.          dead = true;
  43.       }
  44.       if(!dead)
  45.       {
  46.          i = _root.depth - 50;
  47.          while(i < _root.depth + 10)
  48.          {
  49.             if(eval("_root.bullet" + i).hitTest(_X,_Y,true) && !eval("_root.bullet" + i).done)
  50.             {
  51.                this.float = true;
  52.                this.floatnum = i;
  53.                eval("_root.bullet" + i).done = true;
  54.             }
  55.             i++;
  56.          }
  57.       }
  58.    }
  59.    else if(!dead)
  60.    {
  61.       if(!takelive)
  62.       {
  63.          if(eval("_root.bullet" + floatnum).letternum != letternum)
  64.          {
  65.             _root.score += 5;
  66.             _root.word.word = "5 Points";
  67.             _root.word.gotoAndPlay("fade");
  68.          }
  69.          else
  70.          {
  71.             _root.score += 10;
  72.             _root.word.word = "Bonus (+10)";
  73.             _root.word.gotoAndPlay("bam");
  74.          }
  75.          takelive = true;
  76.       }
  77.       _X = eval("_root.bullet" + floatnum)._x;
  78.       _Y = eval("_root.bullet" + floatnum)._y;
  79.       _alpha = 60;
  80.       if(_Y <= -50)
  81.       {
  82.          removeMovieClip(this);
  83.       }
  84.    }
  85.    else if(!takepoints)
  86.    {
  87.       _root.hud.pain.play();
  88.       this.gotoAndStop(_totalframes);
  89.       if(!donttake)
  90.       {
  91.          _root.lives -= 1;
  92.       }
  93.       takepoints = true;
  94.    }
  95. };
  96.